package com.dlc.shop.user.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dlc.shop.user.common.model.PopupRelate;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 弹窗广告关联
 * @author TRACK
 */
public interface PopupRelateMapper extends BaseMapper<PopupRelate> {

    /**
     * 根据弹窗广告关联id获取弹窗广告关联
     * @param popupId 弹窗广告id
     * @return 弹窗广告关联
     */
    List<PopupRelate> getByPopupId(@Param("popupId") Long popupId);

    /**
     * 批量保存
     * @param popupRelates 弹窗广告关联
     */
    void saveBatch(@Param("popupRelates") List<PopupRelate> popupRelates);

    /**
     * 根据弹窗广告id删除弹窗广告关联
     * @param popupId id
     */
    void deleteById(@Param("popupId") Long popupId);

    /**
     * 根据弹窗广告关联id删除弹窗广告关联
     * @param relateIds
     */
    void deleteByRelateIds(@Param("relateIds") List<Long> relateIds);
}
